<!-- 危化品管理-危废品资料-危废代码 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>
          <el-col :span="6">
            <el-form-item label="危废类别编号">
              <el-input v-model="listQuery.fcatno" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="危废类别名称">
              <el-input v-model="listQuery.fcatname" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
              <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <el-button type="warning" icon="el-icon-upload2">导入</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FCATTYPE" label="危废类别编号" width="105"></el-table-column>
          <el-table-column prop="FCATNAME" label="行业来源" ></el-table-column>
          <el-table-column prop="FCATNO" label="危废代码" width="95"></el-table-column>
          <el-table-column prop="FCATFLAG" label="危险危废"></el-table-column>
          <el-table-column prop="FCATLABEL" label="危险特性" width="95"></el-table-column>
          <el-table-column prop="FMEMO" label="主要危险成分"></el-table-column>
          <el-table-column prop="FVISIBLE" label="状态" width="85">
            <template slot-scope="scope">
              {{ scope.row.FVISIBLE | dynamicText(fvisiblelist) }}
            </template>
          </el-table-column>
          <el-table-column fixed="left" label="操作" width="150">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                编辑
              </el-button>
              <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" />
        <Form ref="Form" :parelist="list" />
      </div>
    </div>
  </div>
</template>

<script>
  import Form from "./Form.vue"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        fvisiblelist: [
          { id: "1", fullName: "有效" },
          { id: "0", fullName: "无效" },
        ],
        total: 0,
        list: [
        {
          "FCATTYPE":"1",
          "FCATNAME":"卫生",
          "FCATNO":"851-001-01",
          "FCATFLAG":"医疗废物",
          "FCATLABEL":"R,In,C,T",
          "FMEMO":"",
          "FVISIBLE":"1",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FCATTYPE":"2",
          "FCATNAME":"化学药品原药制造",
          "FCATNO":"271-001-02",
          "FCATFLAG":"化学药品原料药生产过程中的蒸馏及反应残渣",
          "FCATLABEL":"T",
          "FMEMO":"",
          "FVISIBLE":"1",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FCATTYPE":"3",
          "FCATNAME":"生物、生化制品的制造",
          "FCATNO":"276-001-02",
          "FCATFLAG":"利用生物技术生产生物化学药品、基因工程药物过程中的蒸馏及反应残渣",
          "FCATLABEL":"T",
          "FMEMO":"",
          "FVISIBLE":"1",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FCATTYPE":"4",
          "FCATNAME":"农药制造",
          "FCATNO":"263-001-04",
          "FCATFLAG":"氯丹生产过程中六氯环戊二烯过滤产生的残渣；氯丹氯化反应器的真空汽提器排放的废物",
          "FCATLABEL":"T",
          "FMEMO":"",
          "FVISIBLE":"1",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FCATTYPE":"5",
          "FCATNAME":"非特定行业",
          "FCATNO":"900-210-08",
          "FCATFLAG":"油/水分离设施产生的废油、污泥",
          "FCATLABEL":"T",
          "FMEMO":"",
          "FVISIBLE":"1",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ],
        loading: false,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fcatno: "",
          fcatname: ""
        },
      };
    },
    computed: {},
    created() {
    },
    methods: {
      insert(row) {
        this.$refs.Form.init(row);
      },
    },
  };
</script>